import { _decorator, Component, Node, director } from 'cc';
import { AudioController } from './AudioController';
import { GameData, GameState } from './GameData';
const { ccclass, property } = _decorator;
const gameData = GameData.getInstance();

@ccclass('StartScene')
export class StartScene extends Component {
    audioController = null;
    
    start() {
        this.audioController = this.node.getComponent(AudioController)
        this.audioController.playStartBgm();
        director.preloadScene('main');
    }

    update(deltaTime: number) {
        
    }
    startGameBtn(){
        gameData.gameSate = GameState.ready;
        this.audioController.stop();
        director.loadScene('main');
    }
}

